﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Imaginecup.gameState.scroll;

namespace Imaginecup.scroll
{
    public class WidthLeftScroll : IScrollProcess
    {
        private double m_CurrentXPos ;
        private int m_MinX = 0;
        private double m_ScrollSpeed ;
        private bool m_bEnd;

        public WidthLeftScroll(double initXPos, double scrollSpeed)
        {
            m_CurrentXPos = initXPos;
            m_ScrollSpeed = scrollSpeed;
            m_bEnd = false;
        }
        public void Scroll(Microsoft.Xna.Framework.GameTime gameTime)
        {
            m_CurrentXPos -= (gameTime.ElapsedGameTime.TotalSeconds * m_ScrollSpeed);

            if (m_CurrentXPos < m_MinX)
            {
                m_CurrentXPos = m_MinX;
                m_bEnd = true;
            }
        }

        public Vector2 GetCurrentStartPos()
        {
            return new Vector2((float)m_CurrentXPos,0);
        }

        public bool IsScrollEnd()
        {
            return m_bEnd;
        }
    }
}
